"use strict";
const common_vendor = require("../../common/vendor.js");
const pages_TUIKit_TUICore_store_index = require("../TUIKit/TUICore/store/index.js");
require("../TUIKit/TUICore/store/modules.js");
require("../TUIKit/TUICore/store/modules/timStore.js");
const tabBar = () => "../../components/tab-bar/tab-bar.js";
const _sfc_main = {
  components: {
    tabBar
  },
  data() {
    return {
      conversationId: ""
    };
  },
  onLoad() {
    common_vendor.index.getStorageSync("conversationWaiting");
    {
      this.toggle();
    }
  },
  onUnload() {
    common_vendor.index.$TUIKit.TUIConversationServer.destroyed();
  },
  methods: {
    start() {
      this.$refs.timer.start();
    },
    toggle() {
      this.$refs.popup.open("center");
    },
    handleJumpToChat() {
      pages_TUIKit_TUICore_store_index.store.commit("timStore/setConversationID", this.conversationId);
      const TUIConversationServer = common_vendor.index.$TUIKit.TUIConversationServer;
      TUIConversationServer.setMessageRead(this.conversationId);
      TUIConversationServer.getConversationProfile(this.conversationId).then((res) => {
        var _a;
        const { conversation } = res.data;
        console.log("create conversation response = ", res);
        pages_TUIKit_TUICore_store_index.store.commit("timStore/setConversation", conversation);
        let url = "/pages/TUIKit/TUIPages/TUIChat/index";
        conversation.userProfile;
        url = `${url}?conversationName=${((_a = conversation.userProfile.nick) == null ? void 0 : _a.nick) || conversation.userProfile.userID}`;
        common_vendor.index.navigateTo({
          url
        });
      }).catch((err) => {
        console.warn("获取 group profile 异常 = ", err);
      });
    }
  }
};
if (!Array) {
  const _easycom_tab_bar2 = common_vendor.resolveComponent("tab-bar");
  const _easycom_smh_timer2 = common_vendor.resolveComponent("smh-timer");
  const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
  (_easycom_tab_bar2 + _easycom_smh_timer2 + _easycom_uni_popup2)();
}
const _easycom_tab_bar = () => "../../components/tab-bar/tab-bar.js";
const _easycom_smh_timer = () => "../../uni_modules/smh-timer/components/smh-timer/smh-timer.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
  (_easycom_tab_bar + _easycom_smh_timer + _easycom_uni_popup)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return {
    a: common_vendor.o((...args) => $options.toggle && $options.toggle(...args)),
    b: common_vendor.p({
      activeIndex: "1"
    }),
    c: common_vendor.sr("timer", "10c7d1c8-2,10c7d1c8-1"),
    d: common_vendor.p({
      auto: true
    }),
    e: _ctx.type === "left" || _ctx.type === "right" ? 1 : "",
    f: common_vendor.sr("popup", "10c7d1c8-1")
  };
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/Project/heart-3.0/heart-field-3.0/pages/consult/consult.vue"]]);
wx.createPage(MiniProgramPage);
